﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TCDL.GLOBAL;
using TCDL.BUS;

namespace TCDL
{
    public partial class frmDangKyKH : Form
    {
        public frmDangKyKH()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnDangKy_Click(object sender, EventArgs e)
        {
            // Code phát sinh mã khách hàng
            String strMaKH = "KH001";
            // End

            int iCount = 8;
            gConnect[] gCon = new gConnect[iCount];
            gCon[0] = new gConnect("@makh", strMaKH);
            gCon[1] = new gConnect("@holotkh", "N");
            gCon[2] = new gConnect("@tenkh", txtHoTen.Text);
            gCon[3] = new gConnect("@diachi", txtDiaChi.Text);
            gCon[4] = new gConnect("@dienthoai", txtDienThoai.Text);
            gCon[5] = new gConnect("@tendn", txtNguoiDung.Text);
            gCon[6] = new gConnect("@matkhau", txtMatKhau.Text);
            gCon[7] = new gConnect("@email", txtEmail.Text);

            XemDSBUS ds = new XemDSBUS();
            ds.ThemDS("sp_ThemKhachHang", gCon, iCount);
        }
    }
}
